package com.sugar.real.estate.module.business.controller.app.userbuildingconsult;

import com.sugar.real.estate.framework.common.pojo.CommonResult;
import com.sugar.real.estate.framework.security.core.util.SecurityFrameworkUtils;
import com.sugar.real.estate.module.business.controller.app.userbuildingconsult.vo.UserBuildingConsultSaveReqVO;
import com.sugar.real.estate.module.business.service.userbuildingconsult.UserBuildingConsultService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

import static com.sugar.real.estate.framework.common.pojo.CommonResult.success;

@Tag(name = "APP - 用户楼盘咨询")
@RestController
@RequestMapping("/biz/user-building-consult")
@Validated
public class AppUserBuildingConsultController {

    @Resource
    private UserBuildingConsultService userBuildingConsultService;

    @PostMapping("/create")
    @Operation(summary = "创建用户楼盘咨询")
    public CommonResult<Boolean> createUserBuildingConsult(@Valid @RequestBody UserBuildingConsultSaveReqVO createReqVO) {
        userBuildingConsultService.createUserBuildingConsult(createReqVO, SecurityFrameworkUtils.getLoginUserId());
        return success(true);
    }
}